﻿using CrmService.Enums;
using CrmService.Models.Data;
using System.Collections.Generic;

namespace CrmService.Repository.Interfaces
{
    /// <summary>
    ///     This interface interacts with the Crm DB to perform CRUD operations on the Idea entity
    /// </summary>
    public interface ICrmRepository
    {
        /// <summary>
        ///     Method to add Ideas to the Crm DB
        /// </summary>
        /// <param name="ideas">
        ///     The list of ideas to be added
        /// </param>
        void AddIdeas(IEnumerable<Idea> ideas);

        /// <summary>
        ///     Method to delete an idea from the Crm DB
        /// </summary>
        /// <param name="idea">
        ///     The Idea to be deleted
        /// </param>
        void DeleteIdea(Idea idea);

        /// <summary>
        ///     Method to find ideas for a given status
        /// </summary>
        /// <param name="status">
        ///     The status to be considered
        /// </param>
        /// <returns>
        ///     The list of ideas for the given status
        /// </returns>
        IEnumerable<Idea> FindIdeasByStatus(IdeaStatus status);

        /// <summary>
        ///     Method to find an idea by its ID
        /// </summary>
        /// <param name="ideaId">
        ///     The idea ID for the idea to be found
        /// </param>
        /// <returns>
        ///     The idea for the given id
        /// </returns>
        Idea FindById(int ideaId);

        /// <summary>
        ///     Method to submit all tracked changes
        /// </summary>
        void Update();

        /// <summary>
        ///     Method to get the list of all Ideas in the Crm DB
        /// </summary>
        /// <returns>
        ///     List of all Ideas.
        /// </returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
            Justification = "Method use is appropriate considering complexity and logic http://msdn.microsoft.com/en-us/library/bzwdh01d(VS.71).aspx#cpconpropertyusageguidelinesanchor1")]
        IEnumerable<Idea> GetAllIdeas();

    }
}
